#include "stdio.h"
#include <stdarg.h>

void my_printf(int a, char *format, ...)
{
    va_list args;
    va_start(args, format);
    int len = vsnprintf(NULL, 0, format, args);
    printf("len === %d \n", len);

    char buffer[len + 1];
    int lenTemp = vsnprintf(buffer, sizeof(buffer), format, args);
    if (lenTemp < 0)
    {   
        printf("error");
    }
    va_end(args);

    printf("buffer===%s \n", buffer);
}